class Processor < ActiveRecord::Base
  attr_accessible :description, :price, :title, :product_url, :cachecapacity, :cachelevel, :clockspeed, :cores
  acts_as_heir_of :product

  validates :description, :price, :title, :product_url, :cachecapacity, :cachelevel, :clockspeed, :cores, presence: true
  validates :price, numericality: {greater_than_or_equal_to: 0.01}
  validates :clockspeed, numericality: {greater_than_or_equal_to: 1800}
  #validates :title, uniqueness: true  ---> En la clase padre
  validates :cachecapacity, :cachelevel, :cores, numericality: {greater_than_or_equal_to: 1}
end
